package com.itheima.a04test;

import java.time.LocalDate;
import java.util.Calendar;

public class Test5 {
    public static void main(String[] args) {
        /*判断闰年还是平年
        jdk7和jdk8两种方法
         */

        //jdk7
        Calendar calendar = Calendar.getInstance();
        calendar.set(2000,2,1);
        calendar.add(Calendar.DAY_OF_MONTH,-1);
        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));

        //jdk8
        LocalDate ld1 = LocalDate.of(2001, 3, 1);
        LocalDate localDate = ld1.plusDays(-1);
        System.out.println(localDate);

    }
}
